<?php
require_once("conf/db_connection.php");
$id = $_GET['id'];
$query_contact="SELECT * FROM contact WHERE trucker_id='".$id."'";
$result_contact=mysql_query($query_contact);
?>
<html>
<head>
<script type="text/javascript" src="lib/js/main.js"></script>
<script type='text/javascript'>
function popCreateContact(id)
{
	xmlhttp_assign=GetXmlHttpObject();
	if (xmlhttp_assign==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_pop_create_contact.php?id="+id;
	xmlhttp_assign.onreadystatechange=function (){
	  if (xmlhttp_assign.readyState==4)
	  {
		parent.disableDiv();
		parent.document.getElementById("pop_div_search").innerHTML = xmlhttp_assign.responseText;
		parent.showPopSearchDiv();
	  }
	}
	xmlhttp_assign.open("GET",url,true);
	xmlhttp_assign.send(null);	
}
</script>
<style type = "text/css">
#hor-minimalist-b {
	background-color: #FFFFFF;
    border-collapse: collapse;
    font-family: Georgia;
    font-size: 12px;
    margin: 10px;
    text-align: left;
    width: 900px;
}
#hor-minimalist-b th {
    border-bottom: 2px solid #5F0C0C ;
    color: #5F0C0C;
    font-size: 12px;
    font-weight: bold;
    padding: 10px 8px;
}
#hor-minimalist-b td {
    border-bottom: 1px solid #888888;
    color: #000000;
    padding: 6px 8px;
}
#hor-minimalist-b tbody tr:hover td {
    //color: #0000CC;
	background-color:#BCC5C6;
}
</style>
</head>
<body>
<table border='1' width='900' style='background-color:white;margin-left:auto;margin-right:auto;background-color:#5F0C0C;color:white;font-family:Georgia;font-size:12px'>
<th>CONTACT LIST</th>
</table>
<table width='900' style='background-color:black;margin-left:auto;margin-right:auto;color:white;font-family:Georgia;font-size:12px'>
<tr>
	<td align = 'left'><input onClick='popCreateContact(<?php echo $id ?>)' type = 'button' id = 'btn_create' name = 'btn_create' value = 'Create' /></td>
</tr>
</table>
<table id='hor-minimalist-b' border='0' width='900' style='margin-left:auto;margin-right:auto'>
<thead>
<tr>
	<th>Name</th>
	<th>Address</th>
	<th>Email</th>
	<th>Cellphone</th>
</tr>
</thead>
<?php
while($row_contact = mysql_fetch_array($result_contact))
{
?>
<tbody>
<tr>
	<td style="text-align:left; font-family:Georgia; font-size:12px">&nbsp;<?php echo $row_contact["name"] ?>&nbsp;</td>
	<td style="text-align:left; font-family:Georgia; font-size:12px">&nbsp;<?php echo $row_contact["address"] ?>&nbsp;</td>
	<td style="text-align:left; font-family:Georgia; font-size:12px">&nbsp;<?php echo $row_contact["email"] ?>&nbsp;</td>
	<td style="text-align:left; font-family:Georgia; font-size:12px">&nbsp;<?php echo $row_contact["cellphone"] ?>&nbsp;</td>
</tr>
</tbody>
<?php
}
?>
</table>		
</body>
</html>

